package cn.col.gszf.controller;

import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletResponse;

/**
 * @Description
 * @Author zhaoning
 * @Date 2024/6/25
 */

@Controller
public class UserController {

    @GetMapping("/index")
    public String index() {
        return "index";
    }

    @GetMapping("/login")
    public String login(Authentication authentication, HttpServletResponse response) {
        if (authentication == null || (!authentication.isAuthenticated())) {
            return "login";
        } else {
            return "admin/index";
        }
    }
}
